<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="admin/_fragments :: head(~{::title})">

  <title>朋友链接发布</title>
</head>
<body>

  <!--导航-->
  <nav th:replace="admin/_fragments :: menu(6)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >

  </nav>

  <!--中间内容-->
  <div  class="m-container-small m-padded-tb-big">
    

    <div class="ui container">
      <form th:action="*{id}==null ? @{/admin/friends} : @{/admin/friends/{id}(id=*{id})} " method="post" class="ui form">
        <div class="field">
          <input type="hidden" name="id" th:value="*{id}">
          <div class="ui left labeled input">
            <label class="ui teal basic label">名称</label>
            <input triend="text" name="friendName" placeholder="请输入名称" th:value="*{friendName}">
          </div>
        </div>
          <br>
          <div class="field">
          <div class="ui left labeled input">
            <label class="ui teal basic label">链接</label>
            <input triend="text" name="url" placeholder="请输入链接" th:value="*{url}">
          </div>
          </div>
          <br>
          <div class="field">
          <div class="ui left labeled input">
            <label class="ui teal basic label">头像地址</label>
            <input triend="text" name="avatar" placeholder="请输入头像地址" th:value="*{avatar}">
          </div>
        </div>
        <br>
        <div class="ui right aligned container">
          <button triend="button" class="ui button" onclick="window.history.go(-1)" >返回</button>
          <button class="ui teal submit button">提交</button>
        </div>

      </form>
    </div>
  </div>

  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <!--底部footer-->
  <footer th:replace="admin/_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive" th:fragment="footer">

  </footer>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<script src="../../static/lib/editormd/editormd.min.js" th:src="@{/lib/editormd/editormd.min.js}"></script>

  <script>

    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
      on : 'hover'
    });

    $('.ui.form').form({
      fields : {
        title : {
          identifier: 'friendName',
          rules: [{
            type : 'empty',
            prompt: '请输入名称'
          }]
        }
      }
    });

  </script>
</body>
</html>